# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Minecrell <minecrell@minecrell.net>
pkgname=device-bq-paella
pkgdesc="BQ Aquaris X5"
pkgver=9
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="postmarketos-base mkbootimg linux-postmarketos-qcom-msm8916
	 soc-qcom-msm8916 soc-qcom-msm8916-rproc"
makedepends="devicepkg-dev"
source="deviceinfo modules-initfs"
subpackages="
	$pkgname-nonfree-firmware:nonfree_firmware
"
_pmb_select="soc-qcom-msm8916-rproc"

# Backwards compatibility for old kernel variant subpackages
replaces="$pkgname-kernel-mainline $pkgname-kernel-mainline-modem"
for pkg in $replaces; do provides="$provides $pkg=$pkgver-r$pkgrel"; done

build() {
	devicepkg_build $startdir $pkgname
}

package() {
	devicepkg_package $startdir $pkgname
}

nonfree_firmware() {
	pkgdesc="GPU/WiFi/BT/Modem/Video firmware"
	depends="firmware-qcom-adreno-a300 msm-firmware-loader
		 firmware-qcom-msm8916-wcnss firmware-bq-picmt-wcnss-nv
		 firmware-qcom-msm8916-venus"
	mkdir "$subpkgdir"
}

sha512sums="
ec9416137ac7e49f564428bd92811ecc557567d3ee9b73061bab6da4d818fbecbbe70d179b91ef98576244bb6793e64b8add8d82a3a0398c5f542ba18978b58f  deviceinfo
ebf6a40372329116a25df1407e671365bb2bf0613f61f0a572fc77890fb0a1760259ab35ed9f002ef2a5c6ee8836bc7bbeb50bf5ac3de14c11e6d96872ad3644  modules-initfs
"
